/*------------------------------------*\
    $TABLES
\*------------------------------------*/
/**
 * Basic table structural styling. 
 * 
 * Designed and built @kurenn  
 */

//Base tables
table {
  max-width: 100%;
  background-color: transparent;
  border-collapse: collapse;
  border-spacing: 0;
  border: none;
}

.table {
  width: 100%;
  margin-bottom: $base-line-height;

  /*Cells */
  th, td {
    padding: 10px;
    line-height: $base-line-height;
    text-align: left;
    vertical-align: top;
    border-top: 1px solid $table-border-color;
  }

  th {
    font-weight: bold;
    border-bottom: 1px solid $table-border-color;
  }

  thead th {
    vertical-align: bottom;
  }

  //Remove border top from thead
  caption + thead tr:first-child th,
  caption + thead tr:first-child td,
  colgroup + thead tr:first-child th,
  colgroup + thead tr:first-child td,
  thead:first-child tr:first-child th,
  thead:first-child tr:first-child td {
    border-top: 0;
  }

  //Adjacents tbody support
  tbody + tbody {
    border-top: 2px solid $table-border-color;
  }

  //Table backgrounds
  @each $color in $colors {
    .tr-#{nth($color, 1)} {
      background-color: lighten(nth($color, 3), 0.9);
      color: #FFF;
    }
  }
}

//Condensed table
.table-condensed {
  th, td {
    padding: 4px 5px;
  }
}

//Striped
.table-striped {
  tbody {
    > tr:nth-child(odd) > td,
    > tr:nth-child(odd) > th {
      background-color: $table-striped-color;
    }

  }
}

//Table bordered
.table-bordered {
  border: 1px solid $table-border-color;

  th, td {
    border: 1px solid $table-border-color;
  }
}
